#define  _CRT_SECURE_NO_WARNINGS 1
#include "SList.h"

text1()
{
	SListNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);
	
	SListPrint(plist);

	SListPushFront(&plist, 10);
	SListPushFront(&plist, 20);
	SListPushFront(&plist, 30);

	SListPrint(plist);
}

text2()
{
	SListNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);

	SListPrint(plist);

	SListPushFront(&plist, 10);
	SListPushFront(&plist, 20);
	SListPushFront(&plist, 30);

	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);

	SListPrint(plist);
}

text3()
{
	SListNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);

	SListPrint(plist);

	//SListPushFront(&plist, 10);
	//SListPushFront(&plist, 20);
	//SListPushFront(&plist, 30);

	//SListPrint(plist);

	//SListPopBack(&plist);
	//SListPopBack(&plist);
	//SListPopBack(&plist);
	//SListPopBack(&plist);
	//SListPopBack(&plist);
	int x = 0;
	scanf("%d", &x);
	SListNode* pos = SListFind(plist, x);
	if (pos != NULL)
	{
		SListInsert(&plist,pos,10);
		//SListErase(&plist, pos);
		//SListErase(&plist,pos);
	}

	//SListPrint(plist);

	//SListEraseAfter(pos);
	//SListEraseAfter(pos);

	SListPrint(plist);

	SListDestroy(&plist);
}

int main()
{
	//text1();
	//text2();
	text3();

	return 0;
}